package com.springboot.demo.config.demo2;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

import java.io.Serializable;

/**
 * Create By Alvin on 2018/9/7
 **/
@Configuration
@Conditional(MyCondition.class)
//这句代码可以标注在类上面，表示该类下面的所有@Bean都会根据这个条件是否通过来确认是否配置
//也可以标注在方法上面，只是对该方法启用配置
//https://www.jianshu.com/p/0740c07f6c1d
public class Config
{
    @Bean
    public Serializable createSerializable()
    {
        System.out.println("======000");
        return "";
    }
}

